<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/base.css">
    <script src=""></script>
    <title>website</title>
</head>
<body>
    <div class="head">
        <span class="title">在线驾考模拟系统</span>
        <ul class="zz" onclick="addInput()">
            <li ><a href="loading.html">登录</a></li>
            <li><a href="register.html">注册</a></li>
        </ul>      
    </div>

    <div class="nav">
        <ul>
            <li><a href="index.html">首页</a></li>
            <!-- <li><a href="exrecise_his.html">顺序练题</a></li> -->
            <li><a href="order_exercise.html">顺序练题</a></li>
            <li><a href="error_book.html">错题本</a></li>
            <li><a href="mock_exam.html">模拟测试</a></li>
            <li><a href="message.html">留言板</a></li>
        </ul>
    </div>

    <div class="content">
        <div class="content-title">
            <span>欢迎登录驾考模拟考试系统</span>
        </div>
        <div class="img">
            <img src="image/index.car.png" alt="">
        </div>
    </div>
    <script>
		if(localStorage.getItem('name')) {
			var suc = document.querySelector('.zz')
			suc.innerHTML = '<li>'+ localStorage.getItem('name')+ '</li>'
			suc.innerHTML += '<li><button onclick="loginOut()">注销</button></li>'
		}
        function loginOut(){
            localStorage.setItem('name','')
            localStorage.setItem('login_symbol','')
            location.href = 'loading.html'
        }
        // no  use
		function addInput(){
			var o = document.createElement("input");
			o.type = "button"
			o.value = "注销"
			// o.addEventListener("click",addInput); // =====>点击调用自己这个完全不明白拿来干嘛
			return o // 创建好了作为一个对象吐出去
		}



       
    </script>
</body>
</html>